home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
manchest.lha
/
MANCHESTER
/
manchester
/
4.1
/
structureString.st
< prev
next >
Wrap
Text File
|
1993-07-24
|
2KB
|
64 lines
" NAME structureString
AUTHOR Bernard Horan <bernard@is.morgan.com>
CONTRIBUTOR Bernard Horan <bernard@is.morgan.com>
FUNCTION print out indented string of a visualComponent structure
ST-VERSIONS 4.1
PREREQUISITES
CONFLICTS
DISTRIBUTION world
VERSION 1.0
DATE May 1993
SUMMARY I created these few methods to help me find my
way around fairly complex visual part structures. Rather than using
the grapher tool (see this archive), I needed a string representation
of the structure. Tabs are used to create an indented representation,
following the composition of the visual components. To see an example,
inspect the browser and print the result of sending the message
#structureString to the topmost component (not the window). BH,
7/5/93"!
'From Objectworks\Smalltalk(R), Release 4.1 of 15 April 1992 on 1 September 1992 at 7:02:36 am'!
!CompositePart methodsFor: 'printing'!
printStructureOn: aStream indent: anIndent
super printStructureOn: aStream indent: anIndent.
components do: [:c | c printStructureOn: aStream indent: anIndent + 1]! !
!BorderDecorator methodsFor: 'printing'!
printStructureOn: aStream indent: anIndent
super printStructureOn: aStream indent: anIndent.
component printStructureOn: aStream indent: anIndent + 1! !
!Wrapper methodsFor: 'printing'!
printStructureOn: aStream indent: anIndent
super printStructureOn: aStream indent: anIndent.
component printStructureOn: aStream indent: anIndent + 1! !
!VisualComponent methodsFor: 'printing'!
printStructureOn: aStream indent: anIndent
anIndent timesRepeat: [aStream tab].
aStream nextPut: ${.
self printOn: aStream.
aStream nextPut: $}.
aStream space.
self bounds printOn: aStream.
aStream cr.!
structureString
| stream |
stream := String new writeStream.
self printStructureOn: stream indent: 0.
stream skip: -1.
^ stream contents! !